<table class="jxgrid" style="width:98%;height:420px;"
       data-options="url: '@Url.Action("SubFileGrid",new { resId = ViewBag.resId  })',cls:'jxfile-grid',border:true,fitColumns:true,fit:false">
    <thead>
        <tr>
            <th data-options="title:'名称',field:'name',width:200,align:'left',formatter: fileNameFormatter"></th>
            <th data-options="title:'虚拟路径',field:'virtualUrl',width:400,align:'left'"></th>
            <th data-options="title:'文件大小',field:'sizeText',width:100,align:'center'"></th>
            <th data-options="title:'操作人',field:'operateUserName',width:100,align:'center'"></th>
            <th data-options="title:'操作时间',field:'operateDateTime',width:160,align:'center',sortable: true"></th>
            <th data-options="title:'',field:'Id',width:50,align:'center',formatter:fileDownFormatter"></th>
        </tr>
    </thead>
</table>
<script>
window.fileNameFormatter = function (v, row) {
    if (!v) return v;
    var url = '@Url.Action("details","file")?id=' + row.Id;
    var options = jx.formatString("{title: '上传文件详细信息',url: '{0}',width: '80%',height: '70%'}", url);
    return jx.formatString('<a class="jxdialog" data-options="{0}">{1}</a>', options, v);
};
window.fileDownFormatter = function (v, row) {
    return '<a href="@Url.Action("Download")?id='+v+'">下载</a>';
};
</script>